<%@ page import="j.framework.qmd.core.QueryManager" %>
<%@ page import="j.framework.qmd.core.QueryFieldMetadata" %>
<%@ page import="java.util.Collection" %>
<%@ page import="j.framework.core.DictItem" %>
<%@ page import="j.util.New" %>
<%@ page import="java.util.List" %>
<%--
    增加/修改字段的footer
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="j" uri="j/tags" %>
<%@ taglib prefix="st" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="joyi" uri="http://www.joyi.cn/tags" %>

<%
    //获取当前查询的所有字段
    Collection<QueryFieldMetadata> list = QueryManager.getQueryMetadata(request.getParameter("key")).getFieldMetadataList();
    List<DictItem> items = New.list(list.size());
    DictItem item;
    for(QueryFieldMetadata f : list){
        item = new DictItem();
        item.setCode(f.getFieldId());
        item.setName(f.getDisplayName());
        items.add(item);
    }
    request.setAttribute("items",items);
%>

<st:form formId="frmFooter" requestId="REQ00000000000000011">
    <input type="hidden" name="footerId" value="${d.footerId}"/>
    <table class="layout">
        <colgroup>
            <col style="width:130px"/>
            <col/>
        </colgroup>
        <tr>
            <th><span class="required">*</span>Footer计算字段:</th>
            <td>
                <joyi:select name="fieldId" required="true" selectedValue="${d.fieldId}" items="${items}"/>
            </td>
        </tr>
        <tr>
            <th><span>*</span>计算方式：</th>
            <td>
                <joyi:select name="calcType" code="DICT2014070115563306" selectedValue="${d.calcType}" required="true"/>
            </td>
        </tr>
        <tr>
            <th>格式化选项:</th>
            <td>
                <input type="text" name="formatOptions" value="${d.formatOptions}" style="width:200px;"/>
            </td>
        </tr>
        <tr>
            <th>行号:</th>
            <td>
                <input type="number" name="rowNumber" value="${d.rowNumber}" style="width:60px;"/>
            </td>
        </tr>
    </table>
</st:form>
